package com.itheima.d3_inner_class3;

public class Test {
    public static void main(String[] args) {
        MaHu maHu=new MaHu();
        move(maHu);
        Sport cat=new Sport() {
            @Override
            void move() {
                System.out.println("cat会跑");
            }
        };
        move(cat);
        move(new Sport(){
            @Override
            void move() {
                System.out.println("牛会跑");
            }
        });

        MaHu maHu1=new MaHu(){
            void showMhu(){
                System.out.println("哈哈");
            }
        };

    }

    private static void move(Sport man){
        System.out.println("开始计时");
        man.move();
        System.out.println("计实结束");
    }
}


abstract class Sport{
    abstract void move();
}

class MaHu extends Sport{
    @Override
    void move() {
        System.out.println("马虎游泳");
    }
}
